package com.example.book.service.impl;

import com.example.book.dao.impl.BookDaoImpl;
import com.example.book.model.Book;
import com.example.book.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BookServiceImpl implements BookService {
    @Autowired
    private BookDaoImpl bookDao;

    @Override
    public int addBook(Book book) {
        return bookDao.insert(book);
    }

    @Override
    public int deleteBook(String id) {
        return bookDao.delete(id);
    }

    @Override
    public int updateBook(Book book) {
        return bookDao.update(book);
    }

    @Override
    public Book queryBookById(String id) {
        return bookDao.queryById(id);
    }

    @Override
    public Integer updateBookStatus(String bookId, String status) {
        return bookDao.updateBookStatus(bookId,status);
    }
}
